Skip to content

Fix magic link first-load redirects#37

Merged
pablonete merged 1 commit into
mainfrom
pablonete-fix-desk-token-redirect
Jun 24, 2026
Merged

Fix magic link first-load redirects#37
pablonete merged 1 commit into
mainfrom
pablonete-fix-desk-token-redirect

Conversation

@pablonete

Copy link
Copy Markdown
Member

Opening a staff magic link directly could briefly render as a guest before the access session finished resolving, which caused protected pages like /desk?token=... to redirect home on the first visit. The same link then worked on a second navigation because the token had already been stored.

This change makes the active magic-link token come from the current URL before falling back to session storage, so first-load requests can authenticate immediately. It also waits until the remote access session is ready before loading protected remote event data, avoiding unauthorized fetches during startup.

Validation:

  • npm run lint
  • npm run build:netlify

Ensure URL magic-link tokens are used immediately on first load and delay protected remote data fetches until the access session has been verified, preventing staff pages from redirecting home before auth resolves.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pablonete pablonete merged commit bafe7a0 into main Jun 24, 2026
2 checks passed
@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for kid-a ready!

Name Link
🔨 Latest commit 2fcbea3
🔍 Latest deploy log https://app.netlify.com/projects/kid-a/deploys/6a3c08413da004000839e723
😎 Deploy Preview https://deploy-preview-37--kid-a.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant